//
//  CBAView.m
//  MY Project For Sport
//
//  Created by dllo on 16/2/1.
//  Copyright © 2016年 dilo. All rights reserved.
//

#import "CBAView.h"
#import <DKNightVersion.h>


#define WIDTH self.frame.size.width
#define HEIGHT self.frame.size.height


#define WEIGHTT [UIScreen mainScreen].bounds.size.width / 375
#define HEIGHTT [UIScreen mainScreen].bounds.size.height / 667


@interface CBAView ()

@property (nonatomic, retain) UILabel *labelForName;
@property (nonatomic, retain) UILabel *labelForWin;
@property (nonatomic, retain) UILabel *labelForLose;
@property (nonatomic, retain) UILabel *shenglv;
@property (nonatomic, retain) UILabel *avrage;

@end


@implementation CBAView

- (void)dealloc {
    [_labelForLose release];
    [_labelForName release];
    [_labelForWin release];
    [_shenglv release];
    [_avrage release];
    
    [super dealloc];
    
}



- (instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    
    if (self) {
        
        [self createSubview];
    }
    
    return self;
    
}

- (void)createSubview {
    
    self.labelForName = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH / 15, WIDTH / 28, WIDTH / 4, WIDTH / 15)];
    [self addSubview:self.labelForName];
    [_labelForName release];
    self.labelForName.text = @"联赛排名";
    self.labelForName.font = [UIFont systemFontOfSize:19];
    self.labelForName.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);
  

    
    //  self.labelForName.backgroundColor = [UIColor grayColor];
    
    self.labelForWin = [[UILabel alloc] initWithFrame:CGRectMake(30 * WEIGHTT + WIDTH / 15 + WIDTH / 4 + WIDTH / 13, WIDTH / 28, WIDTH / 13, WIDTH / 15)];
    [self addSubview:self.labelForWin];
    [_labelForWin release];
    self.labelForWin.font = [UIFont systemFontOfSize:15];
    self.labelForWin.text = @"胜";
    self.labelForWin.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);

      //self.labelForWin.backgroundColor = [UIColor greenColor];
    
    self.labelForLose = [[UILabel alloc] initWithFrame:CGRectMake(30 * WEIGHTT + WIDTH / 15 + WIDTH / 4 + WIDTH / 13 + WIDTH / 16 * 2, WIDTH / 28 , WIDTH / 13, WIDTH / 15)];
    [self addSubview:self.labelForLose];
    [_labelForLose release];
    self.labelForLose.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);

    self.labelForLose.font = [UIFont systemFontOfSize:15];
    self.labelForLose.text = @"负";
    //self.labelForLose.backgroundColor = [UIColor yellowColor];
    
    self.shenglv = [[UILabel alloc] initWithFrame:CGRectMake(30 * WEIGHTT + WIDTH / 15 + WIDTH / 4 + WIDTH / 13 * 4, WIDTH / 28, WIDTH / 9, WIDTH / 15)];
    self.shenglv.text = @"胜率";
    [self addSubview:self.shenglv];
    [_shenglv release];
    self.shenglv.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);

    self.shenglv.font = [UIFont systemFontOfSize:15];
    //self.labelForShenglv.backgroundColor = [UIColor blueColor];
    
    self.avrage = [[UILabel alloc] initWithFrame:CGRectMake(30 * WEIGHTT + WIDTH / 20 + WIDTH / 15 + WIDTH / 4 + WIDTH / 13 * 5, WIDTH / 28, WIDTH / 6, WIDTH / 15)];
    self.avrage.text = @"平均得分";
    [self addSubview:self.avrage];
    [_avrage release];
    self.avrage.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);

    self.avrage.font = [UIFont systemFontOfSize:15];
    
}






/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
